﻿using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
namespace Zhao.Models.Entity
{
    /// <summary>
    /// 订单表（支付凭证）
    ///</summary>
    [SugarTable("Orders")]
    public class Orders
    {

        /// <summary>
        /// 备  注:
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "OrderID", IsPrimaryKey = true, IsIdentity = true)]
        public int OrderID { get; set; }

        /// <summary>
        /// 备  注:用户Id
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "UserId")]
        public int UserId { get; set; }

        /// <summary>
        /// 备  注:订单金额
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "TotalAmount")]
        public decimal TotalAmount { get; set; }

        /// <summary>
        /// 备  注:支付方式（如：微信支付/余额支付）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "PaymentMethod")]
        public short? PaymentMethod { get; set; }

        /// <summary>
        /// 备  注:支付成功时间（NULL表示未支付）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "PaymentTime")]
        public DateTime PaymentTime { get; set; }

        /// <summary>
        /// 备  注:第三方支付流水号（对账用）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "TransactionID")]
        public string? TransactionID { get; set; }

        /// <summary>
        /// 备  注:订单创建时间
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "CreatedAt")]
        public DateTime CreatedAt { get; set; }

        /// <summary>
        /// 备  注:订单类型id订单类型id 1充值 3提现 5活动支付 7场地预定 9订单取消退款 10部分退款 11订单补购 
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "TypeId")]
        public short TypeId { get; set; }

        /// <summary>
        /// 备  注:活动表id（如果是参加活动报名费用必须填上）
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "ActivityId")]
        public int? ActivityId { get; set; }

        /// <summary>
        /// 备  注:订单状态  1待支付 3正常 5已退款/部分退款
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName = "Status")]
        public short Status { get; set; }
        /// <summary>
        /// 如果是退款了 需要填写对应的退款记录编号或者退款记录信息
        /// </summary>
        [SugarColumn(ColumnName = "RefundTransaction")]
        public string  RefundTransaction { get; set; }
        /// <summary>
        /// 实际退款金额
        /// </summary>
        [SugarColumn(ColumnName = "RefundAmount")]
        public decimal? RefundAmount { get; set; }
        /// <summary>
        /// 报名变更表id
        /// </summary>
        [SugarColumn(ColumnName = "RelatedChangeOrderId")]
        public int RelatedChangeOrderId { get; set; }
        /// <summary>
        /// 退款id
        /// </summary>
        [SugarColumn(ColumnName = "RefundTransactionId")]
        public int? RefundTransactionId { get; set; }
    }

}